package com.kilomob.grady.handler.netty;

import java.util.concurrent.TimeUnit;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.timeout.IdleStateHandler;

import com.kilomob.grady.codec.protostuff.ProtostuffCodec;
import com.kilomob.grady.codec.protostuff.ProtostuffDecoder;
import com.kilomob.grady.codec.protostuff.ProtostuffEncoder;
import com.kilomob.grady.handler.NettySendHandler;

public class ProtostuffSendHandler implements NettySendHandler {
    
    public void handle(String id,ChannelPipeline pipeline) {
        ProtostuffCodec util = new ProtostuffCodec();
        util.setRpcDirect(false);
        pipeline.addLast(new ProtostuffEncoder(util));
        pipeline.addLast(new ProtostuffDecoder(util));
        pipeline.addLast(new MessageSendHandler(id));
    }
}
